#include <vector>
#include<unordered_map>
#include<array>
#include <map>
#include<string>
class Solution {
public:
    int findTheLongestSubstring(std::string s) {
        int n  = s.size();
        std::array<int, 32> map ;
        map.fill(-2);
        map[0] = -1;
        int ans =0;
        int status = 0;
        int m = 0;
        for(int i = 0 ; i < n ; i++)
        {
            m = move(s.at(i));
            if (m!=-1)
            {
                status ^= 1 << m;
            }
            if (map[status] != -2)
            {
                ans = std::max(ans,i-map[status]);
            }else
            {
                map[status] = i;
            }
        }
        return ans;
    }
    int move(char c)
    {
        switch(c)
        {
            case 'a':return 0;
            case 'e':return 1;
            case 'i':return 2;
            case 'o':return 3;
            case 'u':return 4;
            default:return -1;
        }
    }
};